<div class="users view">
<h2><?php echo __('User'); ?></h2>
<table class="table">
    <tbody>
        <tr>
            <td><?php echo __('Id'); ?></td>
            <td>
                    <?php echo h($user['User']['id']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('First Name'); ?></td>
            <td>
                    <?php echo h($user['User']['first_name']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Last Name'); ?></td>
            <td>
                    <?php echo h($user['User']['last_name']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Username'); ?></td>
            <td>
                    <?php echo h($user['User']['username']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Email'); ?></td>
            <td>
                    <?php echo h($user['User']['email']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Phone'); ?></td>
            <td>
                    <?php echo h($user['User']['phone']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Role'); ?></td>
            <td>
                    <?php echo h($user['User']['role']); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Location'); ?></td>
            <td>
                    <?php echo $this->Html->link($user['Location']['name'], array('controller' => 'locations', 'action' => 'view', $user['Location']['id'])); ?>
                    &nbsp;
            </td>
        </tr>
        <tr>
            <td><?php echo __('Status'); ?></td>
            <td>
                    <?php echo h($user['User']['status']); ?>
                    &nbsp;
            </td>
        </tr>
    </tbody>
</table>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit User'), array('action' => 'edit', $user['User']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete User'), array('action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Users'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New User'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Locations'), array('controller' => 'locations', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Location'), array('controller' => 'locations', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Products'), array('controller' => 'products', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Product'), array('controller' => 'products', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Products'); ?></h3>
	<?php if (!empty($user['Product'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Category Id'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Title'); ?></th>
		<th><?php echo __('Status'); ?></th>
		<th><?php echo __('Type'); ?></th>
		<th><?php echo __('Price'); ?></th>
		<th><?php echo __('Description'); ?></th>
		<th><?php echo __('Location Id'); ?></th>
		<th><?php echo __('Address'); ?></th>
		<th><?php echo __('Picture1'); ?></th>
		<th><?php echo __('Picture2'); ?></th>
		<th><?php echo __('Picture3'); ?></th>
		<th><?php echo __('Picture4'); ?></th>
		<th><?php echo __('Posted Date'); ?></th>
		<th><?php echo __('Expired Date'); ?></th>
		<th><?php echo __('Modified Date'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($user['Product'] as $product): ?>
		<tr>
			<td><?php echo $product['id']; ?></td>
			<td><?php echo $product['category_id']; ?></td>
			<td><?php echo $product['user_id']; ?></td>
			<td><?php echo $product['title']; ?></td>
			<td><?php echo $product['status']; ?></td>
			<td><?php echo $product['type']; ?></td>
			<td><?php echo $product['price']; ?></td>
			<td><?php echo $product['description']; ?></td>
			<td><?php echo $product['location_id']; ?></td>
			<td><?php echo $product['address']; ?></td>
			<td><?php echo $product['picture1']; ?></td>
			<td><?php echo $product['picture2']; ?></td>
			<td><?php echo $product['picture3']; ?></td>
			<td><?php echo $product['picture4']; ?></td>
			<td><?php echo $product['posted_date']; ?></td>
			<td><?php echo $product['expired_date']; ?></td>
			<td><?php echo $product['modified_date']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'products', 'action' => 'view', $product['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'products', 'action' => 'edit', $product['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'products', 'action' => 'delete', $product['id']), null, __('Are you sure you want to delete # %s?', $product['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Product'), array('controller' => 'products', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
